import { defineStore } from 'pinia'
export const userPiniaStore = defineStore('userPiniaStore', {
    state: () => ({
        user: localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')!) : {},
        banji: localStorage.getItem('banji') ? JSON.parse(localStorage.getItem('banji')!) : {},
        banjidata: [],
        refrechgaun: [],
        batchdelguan: [],
        batchguanteacher: [],
        batchdelteacher: [],
        settinbanji: [],
        setinTeacher: [],
        delgyanbanji: [],
        delgyanTeacher: [],

    }),
    actions: {
        getbanjidata(data: any) {
            this.banjidata = data
        },
        setbanji(data: any) {
            this.banji = { ...data }
            localStorage.setItem('banji', JSON.stringify(data))
        },
        setbanjiId(data: any) {
            this.refrechgaun = data
        },
        //设置页管理员班级批量删除
        setbatchdelguan(data: any) {
            this.batchdelguan = data
        },
        //设置页面新增教师
        setAddTeacher(data: any) {
            this.batchguanteacher = data
        },
        setbatchdelteacher(data: any) {
            this.batchdelteacher = data
        },

        setsettinbanji(data: any) {
            this.settinbanji = data
        },
        setsetinTeacher(data: any) {
            this.setinTeacher = data
        },
        setdelgyanbanji(data: any) {
            this.delgyanbanji = data
        },
        setdelgyanTeacher(data: any) {
            this.delgyanTeacher = data
        }

    }
})